package com.enzoism.springboot.fastjson.controller;

import com.enzoism.springboot.fastjson.dao.ScoresDao;
import com.enzoism.springboot.fastjson.model.Scores;
import com.enzoism.springboot.fastjson.result.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ScoresController {
    @Autowired
    public ScoresDao scoresDao;

    @GetMapping("get/{id}")
    public RequestResult getScoreList(@PathVariable Integer id){
        Scores scores = scoresDao.selectByPrimaryKey(id);
        return RequestResult.success(scores);
    }
}
